/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 下单 POST /tourism/client/c/order/add */
export async function addUsingPost1({
  body,
  options,
}: {
  body: API.BizTicketOrderAddParam;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultMapStringObject_>(
    '/tourism/client/c/order/add',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 对订单评论 POST /tourism/client/c/order/addcomment */
export async function addCommentUsingPost({
  body,
  options,
}: {
  body: API.BizCommentAddParam;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultString_>(
    '/tourism/client/c/order/addcomment',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 获取订单详情 GET /tourism/client/c/order/detail */
export async function detailUsingGet1({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.detailUsingGET1Params;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultBizOrder_>('/tourism/client/c/order/detail', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 分销订单列表 查询当前登录用户作为分销用户邀请到的用户为其带来的分销订单列表及统计信息。返回数据包含：1. orders: 订单分页信息，每个订单包含commission字段表示当前用户的分佣金额2. stats: 分销统计信息，包含：   - totalOrders: 总订单数   - totalAmount: 总金额   - totalCommission: 总佣金   - monthlyStats: 按月统计的订单金额可能的错误：- 如果当前用户不是分销用户，将返回空数据 GET /tourism/client/c/order/distribution/page */
export async function distributionOrderPageUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.distributionOrderPageUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultMapStringObject_>(
    '/tourism/client/c/order/distribution/page',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 用户历史订单 GET /tourism/client/c/order/page */
export async function pageUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.pageUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultPageBizOrder_>(
    '/tourism/client/c/order/page',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 更新订单预约时间 POST /tourism/client/c/order/updateReservationTime */
export async function updateReservationTimeUsingPost({
  body,
  options,
}: {
  body: API.BizOrderUpdateReservationTimeParam;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultString_>(
    '/tourism/client/c/order/updateReservationTime',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** 游客信息 GET /tourism/client/c/order/userinfo */
export async function userinfoUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.userinfoUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultListBizUserTicket_>(
    '/tourism/client/c/order/userinfo',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}
